#include <stdio.h>

int main()
{
    int n, a, b;
    double sum = 0, price = 0;
    scanf("%d", &n);
    while (n-- > 0)
    {
        scanf("%d%d", &a, &b);
        switch(a)
        {
            case 1: price = 2.98; break;
            case 2: price = 4.50; break;
            case 3: price = 9.98; break;
            case 4: price = 4.49; break;
            case 5: price = 6.87; break;
            default: ; /* shouldn't come here */
        }
        sum += price * b;
    }
    printf("%.2lf\n", sum);
    return 0;
}


